package com.example.back.service;

import com.example.back.entity.Comment;
import com.example.back.mapper.CommentMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;

@Service
public class CommentService {
    @Autowired
    private CommentMapper commentMapper;
    public int addComment(Comment comment)
    {
        return commentMapper.addComment(comment);
    }
    public int deleteComment(Integer id)
    {
        return commentMapper.deleteComment(id);
    }
    public int updateComment(Comment comment)
    {
        return commentMapper.updateComment(comment);
    }
    public Comment queryCommentById(Integer id)
    {
        return commentMapper.queryCommentById(id);
    }
    public ArrayList<Comment> queryComments(Comment comment)
    {
        return commentMapper.queryComments(comment);
    }
}
